filesystemmodel: Add a missing check
authorBenjamin Otte <otte@redhat.com>
Sun, 2 Oct 2011 03:27:41 +0000 (05:27 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 3 Oct 2011 16:29:21 +0000 (18:29 +0200)
Paths with depth > 1 should return FALSE instead of pretending the depth
is 1.

gtk/gtkfilesystemmodel.c

index 92f44ddbf4e75236be8ed556c1c689a05ab0bcd2..15497e645fcc2d0429f7cc8585869417c91cae23 100644 (file)
@@ -512,6 +512,9 @@ gtk_file_system_model_get_iter (GtkTreeModel *tree_model,
 {
   g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
 
+  if (gtk_tree_path_get_depth (path) > 1)
+    return FALSE;
+
   return gtk_file_system_model_iter_nth_child (tree_model, 
                                                iter,
                                                NULL,